<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<style>
  *{
    padding: 0;
    margin: 0;
  }
  .container{
    overflow: hidden;
    padding: 0 210px;
  }
  .center{
    float: left;
    width: 100%;
    height: 200px;
    background: rosybrown;
  }
  .left{
    float: left;
    width: 200px;
    height: 200px;
    background: red;
    margin-left: -100%;
    position: relative;
    left: -210px;
  }
  .right {
    float: left;
    width: 200px;
    height: 200px;
    background: cadetblue;
    margin-left: -200px;
    position: relative;
    right: -210px;
  }
</style>
<body>
  <div class="container">
    <div class="center">zhongian</div>
    <div class="left">左边</div>
    <div class="right">右边</div>
  </div>
</body>
<script>
  // Promise.all
Promise.all = function (promises) {
  var values = [];
  var count = 0;
  return new Promise((resolve, reject) => {
    Promise.forEach((promise, index) => {
      Promise.resolve(promise).then((res) => {
        count++
        values[index] = res;
        if (count === promises.length) {
          resolve(values)
        }
      }, err => {
        console.log(err)
      })
    })
  })
}

let p1 = new Promise((resolve, reject) => {
  resolve('1')
}).then((res) => {
  Promise.reject(res)
}).catch(err => {
  console.log(err, '22')
})

</script>
</html>